STEP 8: We are now ready to create our net! We know the x-coordinate is 90, but we will be surprised by the y-coordinate every time!

  • Click GRAPHICS, then click and drag in Sprite at Position.
  • Change the image label from "codester" to "soccernet".
  • Change the x-coordinate from 0 to netx and the y-coordinate from 0 to nety.

To navigate the page using the TAB key, first press ESC to exit the code editor.

stage.set_axis(100) stage.create_grid_overlay(10, "grey") stage.set_background("soccerfield") ballx = -80 bally = random.randint(-100,100) # sprite = codesters.Sprite("image", x, y) ball = codesters.Sprite("soccerball", ballx, bally) netx = 90 nety = random.randint(-100,100)
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)